package cn.datawin.bms.modules.provider.controller;

import cn.datawin.bms.modules.provider.service.ProvApiProgramService;
import cn.datawin.bms.provider.entity.ProvApiProgramEntity;
import cn.datawin.common.core.util.R;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 上游供应商接入方式
 *
 * @author datawin-sms
 * @date 2025-08-20 15:54:38
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/provider/apiProgram" )
@Tag(description = "provApiProgram" , name = "上游供应商接入方式管理" )
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class ProvApiProgramController {

    private final ProvApiProgramService provApiProgramService;


	/**
	 * 获取所有上游供应商接入方式
	 */
	@Operation(summary = "获取所有上游供应商接入方式" , description = "获取所有上游供应商接入方式" )
	@GetMapping("/listAll" )
	@PreAuthorize("isAuthenticated()")  // 只需要登录权限
	public R getAllProvApiProgram() {
		LambdaQueryWrapper<ProvApiProgramEntity> wrapper = Wrappers.lambdaQuery();
		return R.ok(provApiProgramService.list(wrapper));
	}


}
